<?php
namespace app\tp\controller;
// use think\config;
 use think\Request;
 use think\Session;
use think\Controller;     //这两个同时出现

class Index10  extends Controller  //这两个同时出现 //这两个同时出现
{
   
	public $data =array(
							'0'=>array(
								'name'=>'仿京东登陆',
								'address'=>'家地址',
								'link'=>'note.php/boot/Login/index',
							),
							'1'=>array(
								'name'=>'仿京东注册',
								'address'=>'地址3',
								'link'=>'link8',
						
							),
							'2'=>array(
								'name'=>'横向二级菜单',
								'address'=>'家地址',
								'link'=>'note.php/boot/Caidan/index',
						
							),
						);

public function index1(){
	echo 'http://www.hyhthjk.com.cn/note.php/tp/Index10/index1';
}


// 公共属性的调用
public function index2(){
	//http://www.hyhthjk.com.cn/note.php/tp/Index10/index2
  dump($this->data);
  $this->index6();
}

public function index6(){
echo"
 <pre>
 <hr/>
 <h4>定义数组</h4>
 public \$data =array(
	'0'=>array(
		'name'=>'仿京东登陆',
		'address'=>'家地址',
		'link'=>'note.php/boot/Login/index',
	),
	'1'=>array(
		'name'=>'仿京东注册',
		'address'=>'地址3',
		'link'=>'link8',

	),
	'2'=>array(
		'name'=>'横向二级菜单',
		'address'=>'家地址',
		'link'=>'note.php/boot/Caidan/index',

	),
);

<h4>在函数里取出公共数组</h4>
public function index2(){
  dump(\$this->data);
  
}

 </pre>
";
}


public function index3(){
	$this->data[3]['name'] = "新增";

}

public function index4(){
	$this->data[3]['address'] = "新增";
}

public function index5(){
	//http://www.hyhthjk.com.cn/note.php/tp/Index10/index5
	$this->index3();
	$this->index4();
	$this->data[3]['linkefd'] = "新增";
	dump($this->data); 
	$this->index7();
}

public function index7(){
echo"
<pre>
<hr/>
 <h4>定义数组</h4>
 public \$data =array(
	'0'=>array(
		'name'=>'仿京东登陆',
		'address'=>'家地址',
		'link'=>'note.php/boot/Login/index',
	),
	'1'=>array(
		'name'=>'仿京东注册',
		'address'=>'地址3',
		'link'=>'link8',

	),
	'2'=>array(
		'name'=>'横向二级菜单',
		'address'=>'家地址',
		'link'=>'note.php/boot/Caidan/index',

	),
);
<h4>在函数a中操作数组</h4>
public function index3(){
	\$this->data[3]['name'] = \"新增\";

}

<h4>在函数b中操作 并 取出数组</h4>
public function index5(){
	//http://www.hyhthjk.com.cn/note.php/tp/Index10/index5
	\$this->index3();
	\$this->data[3]['linkefd'] = \"新增\";
	dump(\$this->data); 

}

</pre>
";
}



}